package com.itheima.reggie.config;

import java.util.Arrays;

/**
 * @Author Yang
 * @Date 2023/3/21 20:00
 */
public class Demo {
    public static void main(String[] args) {
        int[] arr ={1,10,3,4,9,6,7,8,5,2};
        int temp;

        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length - i - 1; j++) {
                if(arr[j]>arr[j+1]){
                    temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=temp;
                }
            }
        }

        System.out.println(Arrays.toString(arr));
    }
}
